<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<c:if test="${pageContext.request.method=='POST'}">
    <sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
        SELECT  * FROM competencias
        where desc_competencia like ?
        order by desc_competencia
        <sql:param value="${param.term}%"/>
    </sql:query>
    <c:if test="${!empty query.rows}">
    [
    <c:forEach var="row" items="${query.rows}">
        {"id":"${row.id_competencia}", "label":"${row.desc_competencia}","value":"${row.desc_competencia}"},
    </c:forEach>
    {"id":"", "label":"","value":""}
    ]
</c:if>
</c:if>